# $Id: PKGBUILD 71912 2012-06-03 10:50:01Z bisson $
# Maintainer: Gaetan Bisson <bisson@archlinux.org>
# Maintainer: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
# Contributor: Callan Barrett <wizzomafizzo@gmail.com>
# Contributor: mucknert <mucknert@gmx.net>

pkgname=offlineimap
pkgver=6.5.4
pkgrel=1
pkgdesc='Synchronizes emails between two repositories'
arch=('any')
url='http://offlineimap.org/'
license=('GPL')
depends=('python2')
makedepends=('python2-docutils')
source=("http://cloud.github.com/downloads/spaetz/offlineimap/offlineimap-v${pkgver}.tar.gz")
sha1sums=('a9ad5f32f8bc0ec042f8059ea9d34282bb8b682a')

package() {
	cd "${srcdir}"/spaetz-offlineimap-*

	python2 setup.py build install --root="${pkgdir}"

	sed 's/env python/env python2/' -i "${pkgdir}"/usr/lib/python2.7/site-packages/offlineimap/imaplib2.py

	sed -i 's/\^/=/g' docs/MANUAL.rst
	rst2man2 docs/MANUAL.rst offlineimap.1
	install -Dm644 offlineimap.1 "${pkgdir}"/usr/share/man/man1/offlineimap.1
	install -Dm644 offlineimap.conf "${pkgdir}"/usr/share/offlineimap/offlineimap.conf
	install -Dm644 offlineimap.conf.minimal "${pkgdir}"/usr/share/offlineimap/offlineimap.conf.minimal
}
